/**

 路由器对象模块

 */

import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '../pages/Login/Login'
import Register from '../pages/Register/Register'
import Password from '../pages/Password/Password'
import MSite from '../pages/MSite/MSite'
import Search from '../pages/Search/Search'
import Preferential from '../pages/Preferential/Preferential'
import Discovery from '../pages/Discovery/Discovery'
import Personal from '../pages/Personal/Personal'
import MyReservation from '../pages/MyReservation/MyReservation'
import MyEvaluate from '../pages/MyEvaluate/MyEvaluate'
import ToEvaluate from '../pages/ToEvaluate/ToEvaluate'
import Feedback from '../pages/Feedback/Feedback'
import DoEvaluate from '../pages/DoEvaluate/DoEvaluate'
import HairSalon from '../pages/HairSalon/HairSalon'
import HairDresser from '../pages/HairSalon/HairDresser/HairDresser'
import HairstyList from '../pages/HairSalon/HairstyList/HairstyList'
import HairDresserDetail from '../pages/HairSalon/HairDresserDetail/HairDresserDetail'
import Reservation from '../pages/HairSalon/Reservation/Reservation'
import ReservationSuccess from '../pages/HairSalon/ReservationSuccess/ReservationSuccess'
import HairstyListDetail from '../pages/HairSalon/HairstyListDetail/HairstyListDetail'

// 声明使用插件
Vue.use(VueRouter)

export default new VueRouter({
  //所有路由
  routes: [
    {
      path: '/',
      redirect: '/msite'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register/:type',
      component: Register,
    },
    {
      path: '/password/:type',
      component: Password
    },
    {
      path: '/msite',
      component: MSite,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/preferential',
      component: Preferential,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/discovery',
      component: Discovery,
      meta: {
        showFooter: true
      }
    },
    {
      path: '/personal',
      component: Personal,
    },
    {
      path: '/myreservation',
      component: MyReservation
    },
    {
      path: '/myevaluate',
      component: MyEvaluate
    },
    {
      path: '/toevaluate',
      component: ToEvaluate
    },
    {
      path: '/feedback',
      component: Feedback
    },
    {
      path: '/doevaluate',
      component: DoEvaluate
    },
    {
      path: '/hairsalon',
      component: HairSalon,
      children: [{
        path: '/hairsalon/hairdresser',
        component: HairDresser
      }, {
        path: '/hairsalon/hairstylist',
        component: HairstyList
      }, {
        path: '',
        redirect: '/hairsalon/hairdresser'
      }]
    },
    {
      path: '/hairdresserdetail',
      component: HairDresserDetail
    },
    {
      path: '/reservation',
      component: Reservation
    },
    {
      path: '/reservationsuccess',
      component: ReservationSuccess
    },
    {
      path: '/hairstylistdetail',
      component: HairstyListDetail
    },
  ]
})

